package com.bsoft.exchange.controller.appointmentandregistration;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.bsoft.exchange.domain.DeptAndDoctor;
import com.bsoft.exchange.pojo.QueryDeptAndDoctorPojo;
import com.bsoft.exchange.response.ResponseEntity;
import com.bsoft.exchange.service.DeptAndDoctorService;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = "appointment")
public class DeptAndDoctorController {
	@Autowired
	private DeptAndDoctorService deptAndDoctorService;
	
	@ApiOperation(value = "医生和科室搜索")
	@RequestMapping(value = "/queryDeptAndDoctor",method = RequestMethod.POST,produces = "application/json")
	public ResponseEntity<List<DeptAndDoctor>> selectList(@RequestBody QueryDeptAndDoctorPojo queryDeptAndDoctorPojo) {
		List<DeptAndDoctor> deptAndDoctor = deptAndDoctorService.selectList(queryDeptAndDoctorPojo.getOrganizationId(),queryDeptAndDoctorPojo.getQuery(),queryDeptAndDoctorPojo.getOutpatientType());
		
			ResponseEntity<List<DeptAndDoctor>> entity=new ResponseEntity<>();
			
			entity.setData(deptAndDoctor);
			
			return entity;
		
	}

}